<%@page import="com.sample.library.service.CategoryLocalServiceUtil"%>
<%@ include file="/jsp/include.jsp" %>
<%
RowChecker rowChecker = null;
rowChecker = new RowChecker(renderResponse);

PortletURL portletURL = renderResponse.createRenderURL();
portletURL.setParameter("action", "viewCategory");

String portletUrlString = portletURL.toString();
%>
<aui:form class="uni-form" action="<%= portletUrlString %>" method="post" name="viewCategoryForm" >
	<liferay-portlet:renderURLParams varImpl="portletURL" />
	<%
		request.setAttribute("toolbarItem", "view-all");
		pageContext.include("toolbar.jsp");
	%>
	<liferay-ui:search-container
		rowChecker="<%= new RowChecker(renderResponse) %>"
		searchContainer="<%= new CategorySearch(renderRequest, portletURL) %>"
	>
		<input name="<portlet:namespace />deleteRowIds" type="hidden" value="" />
		<liferay-ui:search-form page="//jsp/category/search.jsp" searchContainer="<%= searchContainer %>" servletContext="<%= this.getServletContext() %>"/>	
		<liferay-ui:search-container-results
			results="<%= CategoryLocalServiceUtil.search(searchContainer, searchContainer.getStart(), searchContainer.getEnd(), searchContainer.getOrderByType(), searchContainer.getOrderByComparator()) %>"
			total="<%= CategoryLocalServiceUtil.searchCount(searchContainer) %>"
		/>
		<liferay-ui:search-container-row
			className="com.sample.library.model.Category"
			modelVar="category"
		>
			<portlet:renderURL var="rowURL">
				<portlet:param name="action" value="editCategory" />
				<portlet:param name="categoryId" value="<%= String.valueOf(category.getCategoryId()) %>" />
			</portlet:renderURL>
				
			<liferay-ui:search-container-column-text href="<%= rowURL %>" property="name" name="Category.Name" />
			<liferay-ui:search-container-column-text href="<%= rowURL %>" property="description" name="Category.Description" />
		</liferay-ui:search-container-row>
	
		<liferay-ui:search-iterator />
	</liferay-ui:search-container>
	
</aui:form>
